// 创建一个原型对象
const carPrototype = {
    wheels: 4,
    color: 'red',
    start () {
        console.log('Starting')
    },
    stop () {
        console.log('stopping')
    }
}

// 使用Object.create()方法克隆
const car1 = Object.create(carPrototype)
console.log(car1)

car1.wheels = 6
console.log(car1.wheels)
console.log(car1.color)

car1.start()
car1.stop()

// 克隆另一个对象
const car2 = Object.create(carPrototype)
console.log(car2)

car2.color = 'blue'
console.log(car2.color)
console.log(car2.wheels)

car2.start()
car2.stop()